
#pragma once

#include <Ogre.h>
#include <OIS/OIS.h>

class ExitListener : public Ogre::FrameListener
{
public:
	ExitListener(OIS::Keyboard *keyboard)
		: mKeyboard(keyboard)
	{
	}

	bool frameStarted(const Ogre::FrameEvent& evt)
	{
		mKeyboard->capture();
		return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
	}

private:
	OIS::Keyboard *mKeyboard;
};